home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libwmf / fund.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-02-16  |  1.7 KB  |  61 lines

  1. /* libwmf (<libwmf/fund.h>): library for wmf conversion
  2.    Copyright (C) 2000 - various; see CREDITS, ChangeLog, and sources
  3.  
  4.    The libwmf Library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public License as
  6.    published by the Free Software Foundation; either version 2 of the
  7.    License, or (at your option) any later version.
  8.  
  9.    The libwmf Library is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.    Library General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU Library General Public
  15.    License along with the libwmf Library; see the file COPYING.  If not,
  16.    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17.    Boston, MA 02111-1307, USA.  */
  18.  
  19.  
  20. #ifndef LIBWMF_FUND_H
  21. #define LIBWMF_FUND_H
  22.  
  23. /* Other fundamental types: is this the best way to do it??
  24.  * Potential conflicts with wv, or other, if not careful...
  25.  */
  26.  
  27. #ifndef U32
  28. #define U32 unsigned int
  29. #endif
  30.  
  31. #ifndef S32
  32. #define S32 int
  33. #endif
  34.  
  35. #ifndef U16
  36. #define U16 unsigned short
  37. #endif
  38.  
  39. #ifndef S16
  40. #define S16 short
  41. #endif
  42.  
  43. #ifndef U8
  44. #define U8 unsigned char
  45. #endif
  46.  
  47. /* How to convert U16 to S16 in an architecturally independent manner ??
  48.  * Casting with `(S16)' may work if `short' is 16 bits, but not in general
  49.  */
  50. #ifdef U16_2_S16
  51. #undef U16_2_S16
  52. #endif /* U16_2_S16 */
  53. #define U16_2_S16(X) (((X) & 0x8000) ? ((S16) ((S32) (X) - (S32) 0x10000)) : ((S16) (X)))
  54.  
  55. #ifdef U16_2_S32
  56. #undef U16_2_S32
  57. #endif /* U16_2_S32 */
  58. #define U16_2_S32(X) (((X) & 0x8000) ? ((S32) (X) - (S32) 0x10000) : ((S32) (X)))
  59.  
  60. #endif /* ! LIBWMF_FUND_H */
  61.